﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;

namespace TriviaViews.Converters
{
    [ValueConversion(typeof(bool), typeof(Uri))]

    class BoolToUriSourceConverter : IValueConverter
    {
        /// <summary>
        /// converts from bool uri object, sets the sound after the user choses an answer indicates if its true or false
        /// </summary>
        /// <param name="value"></param>
        /// <param name="targetType"></param>
        /// <param name="parameter"></param>C:\Users\rahelly\Desktop\Final 29.5.2011\TriviaGameRahelly\TriviaViews\Sounds\coins-in-hand-4.mp3
        /// <param name="culture"></param>
        /// <returns></returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(bool)value)
            {
                //C:/Users/rahelly/Desktop/Final 29.5.2011/TriviaGameRahelly/TriviaViews/fail-trombone-03.mp3"
                return new Uri(@"C:\Users\rahelly\Desktop\Final 29.5.2011\TriviaGameRahelly\TriviaViews\Sounds\fail-trombone-03.mp3");
                //return new Uri("/TriviaViews;component/Sounds/fail-trombone-03.mp3", UriKind.RelativeOrAbsolute);
            }
                
            return
                 //return new Uri("C:/Users/rahelly/Desktop/Final 29.5.2011/TriviaGameRahelly/TriviaViews/coins-in-hand-4.mp3");
                new Uri("/Sounds/coins-in-hand-4.mp3",UriKind.Relative);

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
